#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

void bubble(int* arr,int y)
{
	int i = 0;
	for (i = 0; i < y; i++)
	{
		int j = 0;
		for (j = 0; j < y - 1; j++)
		{
			int b = 0;
			if (arr[j] > arr[j + 1])
			{
				b = arr[j];
				arr[j] = arr[j + 1];
				arr[j + 1] = b;
			}
		}
		printf("%d ", arr[i]);
	}
}


int main()
{
	int arr[] = { 2,8,7,3,4,5 };
	int sz = sizeof(arr) / sizeof(arr[0]);
	bubble(arr,sz);
	return 0;
}